package org.pupil.proxy;

import org.pupil.common.constants.RpcProxy;
import org.pupil.proxy.cglib.CgLibProxyFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 代理层抽象工厂
 * @Author: pupil
 * @Date: 2024/07/10 下午 4:26
 */
public class ProxyFactory {

    private static Map<RpcProxy,IProxy> proxyIProxyMap = new HashMap<>();

    static {
        proxyIProxyMap.put(RpcProxy.CG_LIB,new CgLibProxyFactory());
    }

    public static IProxy get(RpcProxy rpcProxy){
        return proxyIProxyMap.get(rpcProxy);
    }
}
